import moment from 'moment';

let dates = [];
let data0 = [];
let data1 = [];
let data2 = [];

const range = [75, 100];

for (let i = 0; i <= 7 * 24; i++) {
    dates.push(moment().subtract(7 * 24 - i, 'hour').format('YYYY-MM-DD HH:mm:SS'));
    data0.push((Math.random() * (range[1] - range[0]) + range[0]).toFixed(2));
    data1.push((Math.random() * (range[1] - range[0]) + range[0]).toFixed(2));
    data2.push((Math.random() * (range[1] - range[0]) + range[0]).toFixed(2));
}

export const historyOptionQ = {
    color: ['#348EED', '#FBDF90'],
    tooltip: {
        trigger: 'axis'
    },
    grid: {
        top: 30,
        bottom: 80,
        left: 60,
        right: 60,
    },
    toolbox: {
        feature: {
            saveAsImage: { name: '', title: '保存' }
        }
    },
    xAxis: {
        data: []
    },
    yAxis: {
        type: 'value'
    },
    // visualMap: {
    //     show: false,
    //     pieces: [{
    //         gt: 0,
    //         lte: 80,
    //         color: '#ffde33'
    //     }, {
    //         gt: 80,
    //         lte: 100,
    //         color: '#348EED'
    //     }]
    // },
    dataZoom: [
        {
            show: true,
            realtime: true,
            start: 0,
            end: 100
        }
    ],
    series: [
        {
            data: [0],
            type: 'line'
        }
    ],
    animationDuration: 1000
};
